﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using OpenNETCF.ORM;
using System.Drawing;

namespace OpenNETCF.Bookshare.Entities
{
    public enum CoverType
    {
        Unknown,
        Hardback,
        Paperback
    }

    public enum BookType
    {
        Unknown = 0x00,
        Fiction = 0x01,
        Nonfiction = 0x02,
        Reference = 0x04,
        Picture = 0x08,
    }

    public enum BarcodeType
    {
        Unknown,
        ISBN,
        SystemCreated
    }

    [Entity(KeyScheme.GUID)]
    internal class Book
    {
        [Field(IsPrimaryKey=true, AllowsNulls=false)]
        public Guid BookID { get; set; }

        [Field]
        public string ISBN { get; set; }

        [Field]
        public string Barcode { get; set; }

        [Field]
        public BarcodeType BarcodeType { get; set; }

        [Field]
        public string Title { get; set; }

        [Field]
        public int? Pages { get; set; }

        [Field]
        public CoverType CoverType { get; set; }

        [Field]
        public BookType BookType { get; set; }

        [Field]
        public bool? IsChapterBook { get; set; }

        [Field]
        public Bitmap CoverArt { get; set; }

        [Field]
        public int? Rating { get; set; }

        [Field]
        public int QtyOnHand { get; set; }

        [Field]
        public DateTime? LastUpdate { get; set; }

        [Field]
        public string Summary { get; set; }
    }
}
